﻿@using SunTzu.Utility;
@model form_referral_apply
@{
    ViewBag.Title = "专场推介会申请";
    Layout = "~/Views/Shared/_LayoutUserCenter.cshtml";
    List<int> industries = new List<int>();
    if(!string.IsNullOrEmpty(Model.Industry))
    {
        industries.AddRange(Model.Industry.Split(',').Select(c => c.ParseToInt()));
    }
    
    bool isWaiting = Model.Id > 0 && Model.State == 0;
    bool isApproved = Model.State == 1;
}
<script src="/js/exhibitor.js"></script>
    <div class="registerForm registerFormInner">
    <form id="editForm" action="/ReferralApply/CreateReferralApply?id=@Model.Id" method="post">
        <p class="registerFormTitle">专场推介会申请表</p>
        @if (isWaiting)
        {
        <p class="hCent redText">* 您的专场推介会申请表已经提交，正在等待审核。您可以继续修改以下内容</p>
        }
        else if (isApproved)
        {
        <p class="hCent redText">* 您的专场推介会申请表已经通过审核。</p>
        }
        <div class="registerFormSubTitle">申请信息</div>
        <p class="hCent">请您将您参展的特色内容或特色产品、展位活动信息填写清楚，以便我们进行遴选和媒体推荐。</p>
        <ul>
            <li class="formProp"><span>*</span>申请单位：</li>
            <li class="formLongLine">
                <input type="text" class="inputLong required" name="Title" id="Title" value="@Model.Title" />
                <span targetId="Title" class="tipMsg">请输入申请单位</span>
            </li>
            <li class="clear"></li>
        </ul>
        <ul>
            <li class="formProp"><span>*</span>单位性质：</li>
            <li class="formLongLine">
                <input type="text" class="inputLong required" name="Type" id="Type" value="@Model.Type" />
                <span targetId="Type" class="tipMsg">请输入单位地址</span>
            </li>
            <li class="clear"></li>
        </ul>
        <ul>
            <li class="formProp"><span>*</span>法人代表：</li>
            <li class="formLongLine">
                <input type="text" class="inputLong required" name="LegalPerson" id="LegalPerson" value="@Model.LegalPerson" />
                <span targetId="LegalPerson" class="tipMsg">请输入法人代表</span>
            </li>
            <li class="clear"></li>
        </ul>
        <ul>
            <li class="formProp"><span>*</span>负责人：</li>
            <li class="formLongLine">
                <input type="text" class="inputLong required" name="MainPerson" id="MainPerson" value="@Model.MainPerson" />
                <span targetId="MainPerson" class="tipMsg">请输入负责人</span>
            </li>
            <li class="clear"></li>
        </ul>
        <ul>
            <li class="formProp"><span>*</span>推介会主题：</li>
            <li class="formLongLine">
                <input type="text" class="inputLong required" name="ReferralTopic" id="ReferralTopic" value="@Model.ReferralTopic" />
                <span targetId="ReferralTopic" class="tipMsg">请输入推介会主题</span>
            </li>
            <li class="clear"></li>
        </ul>
        <ul>
            <li class="formProp"><span>*</span>推介会内容：</li>
            <li class="formLongLine">
                <input type="text" class="inputLong required" name="ReferralContent" id="ReferralContent" value="@Model.ReferralContent" />
                <span targetId="ReferralContent" class="tipMsg">请输入推介会内容</span>
            </li>
            <li class="clear"></li>
        </ul>
        <ul>
            <li class="formProp">其他活动安排：</li>
            <li class="formLongLine">
                <input type="text" class="inputLong" name="Activity" id="Activity" value="@Model.Activity" />
            </li>
            <li class="clear"></li>
        </ul>
        <ul>
            <li class="formProp"><span>*</span>推介人：</li>
            <li class="formLongLine">
                <input type="text" class="inputLong required" name="ReferralPerson" id="ReferralPerson" value="@Model.ReferralPerson" />
                <span targetId="ReferralPerson" class="tipMsg">请输入推介人</span>
            </li>
            <li class="clear"></li>
        </ul>
        <ul>
            <li class="formProp"><span>*</span>职务：</li>
            <li class="formLongLine">
                <input type="text" class="inputLong required" name="ReferralTitle" id="ReferralTitle" value="@Model.ReferralTitle" />
                <span targetId="ReferralTitle" class="tipMsg">请输入职务</span>
            </li>
            <li class="clear"></li>
        </ul>
        <ul>
            <li class="formProp"><span>*</span>所属行业：</li>
            <li class="formLongLine">
                <ul class="multiSelections">
                @foreach (var industry in CacheHelper<code_industry>.GetAll().OrderBy(c => c.Order))
                {
                    <li @(industry.Title == "其他" ? "class=multiSelectionInput" : "")>
                        <input type="checkbox" @(industries.Contains(industry.Id) ? "checked" : "") name="Industry" value="@industry.Id" /> @industry.Title
                        @if (industry.Title == "其他")
                        {
                        <input type="text" name="ScopeOtherName" class="inputNormal" value="@Model.IndustryOtherName" />
                        }
                    </li>
                }
                </ul>
            </li>
            <li class="clear"></li>
        </ul>
        <ul>
            <li class="formProp"><span>*</span>企业邀请听众：</li>
            <li class="formLongLine">
                <input type="text" class="inputLong required num" name="InvitePeopleCount" id="InvitePeopleCount" value="@Model.InvitePeopleCount" />
                <span targetId="InvitePeopleCount" class="tipMsg">请输入企业邀请听众</span>
            </li>
            <li class="clear"></li>
        </ul>
        <ul>
            <li class="formProp">服务需求：</li>
            <li class="formLongLine">
                <input type="text" class="inputLong" name="Requirement" id="Requirement" value="@Model.Requirement" />
            </li>
            <li class="clear"></li>
        </ul>
        <ul>
            <li class="formProp"><span>*</span>单位地址：</li>
            <li class="formLongLine">
                <input type="text" class="inputLong required" name="Address" id="Address" value="@Model.Address" />
                <span targetId="Address" class="tipMsg">请输入单位地址</span>
            </li>
            <li class="clear"></li>
        </ul>
        <ul>
            <li class="formProp"><span>*</span>联系人：</li>
            <li class="formLongLine">
                <input type="text" class="inputLong required" name="Contacter" id="Contacter" value="@Model.Contacter" />
                <span targetId="Contacter" class="tipMsg">请输入联系人</span>
            </li>
            <li class="clear"></li>
        </ul>
        <ul>
            <li class="formProp"><span>*</span>联系电话：</li>
            <li class="formLongLine">
                <input type="text" class="inputLong required" name="Tel" id="Tel" value="@Model.Tel" />
                <span targetId="Tel" class="tipMsg">请输入联系电话</span>
            </li>
            <li class="clear"></li>
        </ul>
        <ul>
            <li class="formProp"><span>*</span>手机：</li>
            <li class="formLongLine">
                <input type="text" class="inputLong required mobile" name="Mobile" id="Mobile" value="@Model.Mobile" />
                <span targetId="Mobile" class="tipMsg">请输入手机</span>
            </li>
            <li class="clear"></li>
        </ul>
        <ul>
            <li class="formProp"><span>*</span>传真：</li>
            <li class="formLongLine">
                <input type="text" class="inputLong required" name="Fax" id="Fax" value="@Model.Fax" />
                <span targetId="Fax" class="tipMsg">请输入传真</span>
            </li>
            <li class="clear"></li>
        </ul>
        <ul>
            <li class="formProp"><span>*</span>Email：</li>
            <li class="formLongLine">
                <input type="text" class="inputLong required email" name="Email" id="Email" value="@Model.Email" />
                <span targetId="Email" class="tipMsg">请输入正确的Email</span>
            </li>
            <li class="clear"></li>
        </ul>
        <ul>
            <li class="formProp">网址：</li>
            <li class="formLongLine">
                <input type="text" class="inputLong" name="Url" id="Url" value="@Model.Url" />
            </li>
            <li class="clear"></li>
        </ul>

        @if (!isApproved)
        {
        <div class="clear"></div>
        <div class="solidLine"></div>
        <div class="buttonBox">
            <a class="smallButton" href="javascript:void()" onclick="$('#editForm').submit();">@(Model.Id == 0 ? "提交申请" : "保存")</a>
            <div style="display: none">
                <input id="submitbutton" type="submit" value="提  交" />
                <input type="button" value="取  消" />
            </div>
        </div>
        }
    </form>
    </div>
